package com.xinxuchu.design.principle.dependenceinversion;

/**
 * @program: java_learning
 * @description
 * @author: 辛旭初
 * @create: 2023-01-29 20:21
 **/
public class Xincuchu {

    private ICourse iCourse;

    public void setiCourse(ICourse iCourse) {
        this.iCourse = iCourse;
    }

    //v3
//    public Xincuchu(ICourse iCourse) {
//        this.iCourse = iCourse;
//    }

    public void studyImoocCourse(){
        iCourse.studyCourse();
    }


//    v2
//    public void studyImoocCourse(ICourse iCourse){
//        iCourse.studyCourse();
//    }

    //v1
//    public void studyJavaCourse(){
//        System.out.println("xuchu is learning java course!");
//    }
//
//    public void studyFECourse(){
//        System.out.println("xuchu is learning java course!");
//    }
}
